package com.third.bank.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.third.bank.entity.Staff;
import com.third.bank.mapper.StaffMapper;
import com.third.bank.service.StaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 职员表serviceimpl
 */
@Service
public class StaffServiceimpl extends ServiceImpl<StaffMapper, Staff> implements StaffService {

    @Autowired
    private StaffMapper staffMapper;

    /**
     * 按照柜员账号查询柜员
     * @param staffAccount
     * @return
     */
    @Override
    public Staff findByAccount(String staffAccount) {
        LambdaQueryWrapper<Staff> lqw = new LambdaQueryWrapper<>();
        lqw.eq(staffAccount != null,Staff::getStaffAccount,staffAccount);

        return staffMapper.selectOne(lqw);
    }
}
